"""
任务十三：还是抓取这5页的数字，计算加和并提交结果
"""
import re

import requests

headers = {
    'User-Agent': 'yuanrenxue.project'
}

url = f"https://match.yuanrenxue.cn/match/13"
session = requests.session()
response = session.get(url, headers=headers)
cookie_list = re.findall("'(.*?)'", response.text)
cookie = ''.join(cookie_list).split(";")[0]
session.cookies.set(cookie.split("=")[0], cookie.split("=")[1])
print(headers)
response1 = session.get("https://match.yuanrenxue.cn/api/match/13", headers=headers)
print(response1.json())